//友链配置详情
toConfiguredetails()
function toConfiguredetails() {
    $.ajax({
        url:root.sroreinter.searchAfterFreeBackMsg,
        cache: false,  //禁用缓存
        type: "POST",
        dataType:'json',
        data: {
            "id":sessionStorage.getItem("id"),
        },

        success: function (data) {
        var shuju =data.data

        if (shuju!=""||shuju!=null) {

            if(shuju.status==10){
                $("#replyDetail").removeAttr("readonly");

                $("#buttons").css({
                    display: "block"
                });
            }else {
                $("#buttons").css({
                    display: "none"
                });
                $("#replyDetail").attr("readonly", "readonly");

                $("#examUserNames").css({
                    display: "inline"
                });
                $("#examTimes").css({
                    display: "inline"
                });
                $("#replyPerson").css({
                    display: "inline"
                });
                $("#replyTime").css({
                    display: "inline"
                });
            }
            if(shuju.status==10){
                $("#status").html("已接收")
            }else if(shuju.status==20){
                $("#status").html("已回复")
            }
            $("#feedbackId").html(shuju.feedbackId)
            var accountType = ""
            if (shuju.accountType == 10) {
                accountType = '分销客户'
            }else if (shuju.accountType == 20) {
                accountType = '普通会员'
            }
            else if (shuju.accountType == 30) {
                accountType = '认证会员'
            }
            else if (shuju.accountType == 40) {
                accountType = '签约非分销'
            }
            $("#accountType").html(accountType)
            $("#loginAccount").html(shuju.loginAccount)
            $("#createTime").html(shuju.createTime)//提交时间
            if(shuju.questionType==10){
                $("#questionType").val("功能问题")
            }else if(shuju.questionType==20){
                $("#questionType").val("商品问题")
            }else if(shuju.questionType==30){
                $("#questionType").val("物流问题")
            }else if(shuju.questionType==40){
                $("#questionType").val("服务问题")
            }else if(shuju.questionType==50){
                $("#questionType").val("其他问题")
            }
            $("#wordsDetail").val(shuju.wordsDetail)
            $("#userName").val(shuju.userName)
            $("#mobilePhone").val(shuju.mobilePhone)

            $("#replyDetail").val(shuju.replyDetail)
            if(shuju.replyTime=="1000-01-01 00:00:00"){
                $("#replyTime").html("")
            }else {
                $("#replyTime").html(shuju.replyTime)
            }
            $("#replyPerson").html(shuju.replyPerson)
            if(shuju.list!=""){
                for(var i=0;i<shuju.list.length;i++) {
                    $("#pics").append('<img onclick="picShow(\'查看图片\',\'../../operate/customerFeedback/picShow.html\',\'' +shuju.list[i].picUrl + '\',\'500\',\'300\',\'110\')" style="max-width: 98px;max-height: 68px;" src="'+shuju.list[i].picUrl+'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;')
                }
            }

        }

        },

    });
}
function picShow(title, url, imgUrl) {
    window.event ? window.event.cancelBubble = true : e.stopPropagation();
    sessionStorage.setItem("imgUrl", imgUrl);
    layer_show(title, url, "800", "500");
}

//回复
function adopt() {
if($("#replyDetail").val()==""){
    $.Huimodalalert("请填写回复内容",2000);
    return false;
}
    $.ajax({
        url:root.sroreinter.updateAfterFreeBackMsg,
        cache: false,  //禁用缓存
        type: "POST",
        dataType:'json',
        contentType: "application/json",
        data: JSON.stringify({
            "id":sessionStorage.getItem("id"),
            "replyDetail":$("#replyDetail").val(),
            "replyPerson":JSON.parse(decodeURIComponent(web.readCookie("loginData"))).user.name,
        }),
        success: function (data) {
            if(data.errorCode==0){
                $.Huimodalalert("确定回复成功",2000);
                toConfiguredetails()
            }else {

                $.Huimodalalert(data.msg,2000);

            }
        },
        error: function () {
            $.Huimodalalert('失败！',2000);
        }
    })
}


